<!-- 储存空间 -->
<template>
  <div id="TrendChart" style="width: 800px; height: 300px; margin: 20px"></div>
</template>

<script lang="ts" setup>
import * as echarts from 'echarts';

let echart = echarts;

const initChart = () => {
  let chart = echart.init(document.getElementById('TrendChart') as any);
  chart.setOption({
    title: {
      text: '近7日使用趋势图',
      left: 'left',
      itemStyle: {
        Color: 'red'
      }
    },
    backgroundColor: '',
    xAxis: {
      type: 'category',
      boundaryGap: true,
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: [
      {
        type: 'value',
        name: '容量',
        min: 0,
        position: 'left',
        axisLabel: {
          formatter: '{value} M'
        }
      }
    ],
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        areaStyle: {}
      }
    ]
  });
};

onMounted(() => {
  initChart();
});
</script>

<style lang="less" scoped></style>
